home *** CD-ROM | disk | FTP | other *** search
/ Enter 2006 October / Enter 10 2006.iso / boot / isolinux / initrd / in / usr / lib / setup / SeTinitrd < prev    next >
Encoding:
Text File  |  2006-07-25  |  4.1 KB  |  126 lines

  1. #!/bin/sh
  2.  
  3. T_PX="`cat $TMP/SeTT_PX`"
  4. TMP=/var/log/setup/tmp
  5. export TEXTDOMAIN=SeTinitrd
  6. sata_mod=""
  7. SATA=""
  8. SCSI=""
  9.  
  10. FS=`cat $TMP/ROOTFS 2>/dev/null`
  11.  
  12.     if [ "$FS" = "ext3" ] ; then
  13.     ROOTFS="--preload=jbd --with=ext3"
  14.     fi
  15.    
  16.     if [ "$FS" = "reiserfs" ] ; then
  17.     ROOTFS="--with=reiserfs"
  18.     fi
  19.    
  20.     if [ "$FS" = "xfs" ] ; then
  21.     ROOTFS="--preload=exportfs --with=xfs"
  22.     fi
  23.    
  24.     if [ "$FS" = "jfs" ] ; then
  25.     ROOTFS="--with=jfs"
  26.     fi
  27.  
  28.     if [ "$FS" = "reiser4" ] ; then
  29.     ROOTFS="--with=reiser4"
  30.     fi
  31.  
  32.  
  33.  
  34. dialog --title "`gettext "INITRD setup"`" --no-cancel --menu \
  35. "`gettext "Now we must setup Initrd image. Initrd is needed to boot your new KateOS \
  36. system. 'simple' mode will configure initrd automatically, use this option, \
  37. if you've installed KateOS on IDE or SATA disk. Use 'expert' mode if you \
  38. are using SCSI disk, or if you need to add extra kernel modules to the initrd."`" 0 0 0 \
  39. "`gettext "simple"`" "`gettext "Configure initrd image automatically"`" \
  40. "`gettext "expert"`" "`gettext "Manual initrd setup"`" 2>$TMP/reply
  41.  
  42. REPLY="`cat $TMP/reply`"
  43. rm -f $TMP/reply
  44.  
  45. if [ "$REPLY" = "`gettext "simple"`" ] ; then
  46.  
  47.     if cat /proc/cmdline | grep sata 1>/dev/null ; then
  48.     SATA=" --preload=libata --preload=sd_mod  --with=sata_sil --with=sata_sil24  --with=sata_nv --with=sata_mv --with=sata_qstor --with=sata_promise --with=sata_sis --with=sata_svw --with=sata_sx4 --with=sata_uli --with=sata_via --with=ata_piix"
  49.     fi
  50.  
  51.     if cat /proc/cmdline | grep scsi 1>/dev/null ; then
  52.     SCSI=" --preload=libata --preload=sd_mod  --with=aic7xxx --with=in2000 --with=aha1542 --with=ahci --with=dc395x --with=dtc --with=g_NCR5380 --with=initio --with-nsp32 --with=pas16 --with=sg --with=ultrastor --with=3w-xxxx"
  53.     fi
  54.    
  55.     if cat /mnt/etc/fstab | grep /dev/hd 1>/dev/null ; then
  56.     IDE="--with=ide-disk"
  57.     fi
  58.  
  59.   
  60. dialog --title "`gettext "Please wait"`" --infobox "`gettext "Making an initrd image, this can take a while... \
  61. You must use this initrd to boot the system, remember to add it into your boot loader configuration file."`" 6 65 
  62.  
  63. if  [ -f /mnt/boot/initrd ] ; then
  64.  
  65.     rm -f /mnt/boot/initrd.old
  66.     mv /mnt/boot/initrd /mnt/boot/initrd.old
  67.  
  68. fi
  69.  
  70. INITRDNAME=initrd
  71.  
  72.  
  73.     if [ ! -f /mnt/sbin/mkinitrd ] ; then    
  74.     dialog --title "`gettext "Error"`" --msgbox "`gettext "No mkinitrd command found. Perhaps you should install 'pkgtools' package ;)"`" 6 60
  75.     exit 1
  76.     else
  77.     chroot /mnt mount proc -t proc /proc &>/dev/null
  78.     chroot /mnt mount sys -t sysfs /sys &>/dev/null
  79.     chroot /mnt mkinitrd $SATA $SCSI $IDE $ROOTFS --splash=1024x768 /boot/initrd `uname -r` 2>/dev/null 
  80.     chroot /mnt umount /proc &>/dev/null 
  81.     chroot /mnt umount /sys &>/dev/null 
  82.     fi
  83.  
  84. fi
  85.  
  86.  
  87. if [ "$REPLY" = "`gettext "expert"`" ] ; then
  88.  
  89. dialog --title "`gettext "INITRD Setup"`" --inputbox  \
  90. "`gettext -e "Here you can type parameters to mkinitrd. If you are using scsi devices, you must \
  91. add here required driver modules. Provided options: \n \n \
  92. '--preload=MODULE' Load the module MODULE before any SCSI modules. This option \
  93. may be used as many times as necessary. \n \n \
  94. '--with=MODULE' Load module MODULE after any SCSI modules. This option \
  95. may be used as many times as necessary. \n \n \
  96. '--nocompress' Skip compression of the initrd image. \n \n \
  97. eg. '--with=sata_sil --with=ide-cd' \n"` \
  98. " 20 72 2> $TMP/reply
  99.  
  100. OPTIONS=`cat $TMP/reply`
  101.  
  102. dialog --title "`gettext "Please wait"`" --infobox "`gettext "Making an initrd image, this can take a while... \
  103. You must use this initrd to boot the system, remember to add it into your boot loader configuration file."`" 6 65 
  104.  
  105. if  [ -f /mnt/boot/initrd ] ; then
  106.  
  107.     rm -f /mnt/boot/initrd.old
  108.     mv /mnt/boot/initrd /mnt/boot/initrd.old
  109.  
  110. fi
  111.  
  112. INITRDNAME=initrd
  113.  
  114.  
  115.     if [ ! -f /mnt/sbin/mkinitrd ] ; then
  116.     dialog --title "`gettext "Error"`" --msgbox "`gettext "No mkinitrd command found. Perhaps you should install 'pkgtools' package ;)"`" 6 60
  117.     exit 1
  118.     else
  119.     chroot /mnt mount proc -t proc /proc &>/dev/null
  120.     chroot /mnt mount sys -t sysfs /sys &>/dev/null
  121.     chroot /mnt mkinitrd $OPTIONS $ROOTFS /boot/initrd `uname -r` 2>/dev/null
  122.     chroot /mnt umount /proc &>/dev/null 
  123.     chroot /mnt umount /sys &>/dev/null 
  124.     fi
  125.     
  126. fi